package com.smmisia.article.entity.convetor;

import com.smmisia.article.dto.socket.GroupMessageDTO;
import com.smmisia.article.entity.GroupMessage;
import org.mapstruct.Mapper;
import org.mapstruct.NullValueCheckStrategy;

import java.util.List;

import static org.mapstruct.factory.Mappers.getMapper;

@Mapper(nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface GroupMessageConvertor {

    GroupMessageConvertor INSTANCE = getMapper(GroupMessageConvertor.class);

    /**
     * 实体转DTO
     * @param groupMessages
     * @return
     */
    List<GroupMessageDTO> toList(List<GroupMessage> groupMessages);
}
